import datetime

from django.db import models
from django.utils import timezone

# Create your models here.

class sheng(models.Model):
    name = models.CharField(max_length=50,verbose_name='省份')

    def __str__(self):
        return self.name

class city(models.Model):
    sheng = models.ForeignKey('sheng', verbose_name="省份",on_delete=models.CASCADE)
    name = models.CharField(max_length=50,verbose_name='城市')

    def __str__(self):
        return self.name

class qu(models.Model):
    city = models.ForeignKey('city', verbose_name="地区",on_delete=models.CASCADE)
    name = models.CharField(max_length=50,verbose_name='地区')

    def __str__(self):
        return self.name


class insert(models.Model):
    name = models.CharField(max_length=50,verbose_name='人名') 
    a = models.ForeignKey('sheng',verbose_name='省份',on_delete=models.CASCADE)
    b = models.ForeignKey('city',verbose_name='城市',on_delete=models.CASCADE)
    c = models.ForeignKey('qu',verbose_name='地区',on_delete=models.CASCADE)

    def __str__(self):
        return self.name
